package com.koron.operation.classes.form.bean.dto;

import com.koron.operation.classes.form.bean.po.ClassesFormRecord;
import com.koron.operation.classes.form.bean.po.ClassesFormShift;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * @author jzp
 * @since 2023/5/25
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ApiModel(value = "上下班面板", description = "ClassesFormRecordDTO")
public class ClassesFormRecordDTO extends ClassesFormShift {

    @ApiModelProperty("是否打卡，0否1是")
    private Integer clockInStatus;

    @ApiModelProperty("日志信息")
    private List<ClassesFormRecord> recordList;

    public Integer getClockInStatus() {
        return recordList == null || recordList.size() == 0 ? 0 : 1;
    }

}
